package com.gtxc.kotlinmvvm.viewmodle

import android.util.Log
import androidx.lifecycle.MutableLiveData
import com.aleyn.mvvm.base.BaseViewModel
import com.blankj.utilcode.util.ToastUtils
import com.gtxc.kotlinmvvm.network.request.ForgetBean
import com.mot.st.network.request.ApiNetWork

/**
 * FileName:ForgetPasswordViewModle
 * Author：Administrator
 * Date:2021 2021/9/29 15:14
 * Copyright (C), 2020-2021,成都拇音科技有限公司
 *
 *
 *
 *
 * Description: 忘记密码viewmodle
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
</desc></version></time></author> */
class ForgetPasswordViewModle : BaseViewModel(){
    //账户名
    val userName = MutableLiveData<String>()
    //密码
    val password1 = MutableLiveData<String>()

    //确认密码
    val password2 = MutableLiveData<String>()
    //验证码
    val code = MutableLiveData<String>()
    //是否显示明文密码（登录注册界面）
    var ok = MutableLiveData<Boolean>()
    fun modificationpass(forgetBean: ForgetBean){
         launchUI {
        val  result=   ApiNetWork.getInstance().postforget(forgetBean)
             if (result.success){
                 Log.i("TAG", "modificationpass: "+result.resultObj)
                 ok.value=result.success
                 ToastUtils.showShort("修改密码成功")
             }
         }
    }
}